import request from '@/utils/request'

// 根据活动类型获取活动列表
export function getActivityListByKind(kind, tenantId) {
  return request({
    url: '/ops/activity/getActivityList',
    method: 'get',
    params: {kind: kind, tenantId: tenantId}
  })
}

// 根据活动状态获取活动列表
export function getActivityListByStatus(status, tenantId) {
  return request({
    url: '/ops/activity/getActivityListByStatus',
    method: 'get',
    params: {status: status, tenantId: tenantId}
  })
}

// 根据活动id获取订单
export function getActivityOrderList(params) {
  return request({
    url: '/ops/activity/getActivityOrderList',
    method: 'get',
    params: {activityId: params}
  })
}

// 根据活动id删除活动
export function deleteActivity(params) {
  return request({
    url: '/ops/activity/deleteActivity',
    method: 'get',
    params: {id: params}
  })
}

// 添加或修改活动
export function addOrUpdateActivity(data) {
  return request({
    url: '/ops/activity/addOrUpdateActivity',
    method: 'post',
    data
  })
}

// 查询活动订单信息
export function getActivityOrders(params) {
  return request({
    url: '/ops/activity/getAllActivityOrders',
    method: 'get',
    params: {tenantId: params}
  })
}

// 根据活动id获取品明细列表
export function getActivityGoodsDetail(params) {
  return request({
    url: '/ops/activityDetail/getActivityDetailList',
    method: 'get',
    params: {activityId: params}
  })
}

// 通过id获得课程详细数据
export function getActivityDetailById(params) {
  return request({
    url: '/ops/activityDetail/getActivityDetailById',
    method: 'get',
    params: {id: params}
  })
}

// 获得课程列表数据
export function getCourseList(data) {
  return request({
    url: '/ops/course/list',
    method: 'post',
    data
  })
}
export function getClassRoomList(data) {
  return request({
    url: '/ops/classroom/classRoomList',
    method: 'post',
    data
  })
}

// 添加或修改活动信息
export function addOrUpdateActivityDetail(data) {
  return request({
    url: '/ops/activityDetail/addOrUpdateActivityDetail',
    method: 'post',
    data
  })
}

// 通过id删除课程明细数据
export function deleteActivityDetailById(params) {
  return request({
    url: '/ops/activityDetail/deleteActivityDetailById',
    method: 'get',
    params: {id: params}
  })
}

// 通过活动id获得商品图片列表数据
export function getActivityPicList(params) {
  return request({
    url: '/ops/activityPic/getActivityPicList',
    method: 'get',
    params: {activityId: params}
  })
}

// 添加或删除活动图片列表数据
export function addOrUpdateActivityPic(data) {
  return request({
    url: '/ops/activityPic/addOrUpdateActivityPic',
    method: 'post',
    data
  })
}

// 通过活动图片id获取活动图片数据
export function getActivityPicById(params) {
  return request({
    url: '/ops/activityPic/getActivityPicById',
    method: 'get',
    params: {id: params}
  })
}

// 通过id删除活动图片数据
export function deleteActivityPicById(params) {
  return request({
    url: '/ops/activityPic/deleteActivityPicById',
    method: 'get',
    params: {id: params}
  })
}

// 通过id获取手动开始数据
export function getStartActivity(params) {
  return request({
    url: '/ops/startActivity/getStartActivity',
    method: 'get',
    params: {activityId: params}
  })
}

// 通过id获取手动开始数据
export function saveOrUpdateStartActivity(data) {
  return request({
    url: '/ops/startActivity/saveOrUpdateStartActivity',
    method: 'post',
    data
  })
}

// 通过id获取活动订单列表数据
export function getActivityOrderListByParams(params) {
  return request({
    url: '/ops/activity/getActivityOrderList',
    method: 'get',
    params: {activityId: params}
  })
}

// 获取活动设置数据
export function getActivitySetting(params) {
  return request({
    url: '/ops/activitySetting/getActivitySetting',
    method: 'get',
    params: {tenantId: params}
  })
}

// 获取活动设置数据
export function saveOrUpdateActivitySetting(data) {
  return request({
    url: '/ops/activitySetting/addOrUpdateActivitySetting',
    method: 'post',
    data
  })
}

// 获取活动概览数据
export function getTinySaleStatistic(data) {
  return request({
    url: '/ops/tinySaleStatistics/getTinySaleStatistic',
    method: 'post',
    data
  })
}

// 获取价格设置列表数据
export function getPricesetList(params) {
  return request({
    url: '/ops/priceset/getPricesetList',
    method: 'get',
    params: {activityDetailId: params}
  })
}

// 获取价格设置数据
export function getPricesetById(params) {
  return request({
    url: '/ops/priceset/getPricesetById',
    method: 'get',
    params: {id: params}
  })
}

// 创建或修改价格设置数据
export function addOrUpdatePriceset(data) {
  return request({
    url: '/ops/priceset/addOrUpdatePriceset',
    method: 'post',
    data
  })
}

// 删除价格设置数据
export function deletePriceset(params) {
  return request({
    url: '/ops/priceset/deletePriceset',
    method: 'get',
    params: {id: params}
  })
}
